package com.example.demo.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2023-07-20
 * Time:17:29
 */
@Controller
@ResponseBody
public class CalcController {
    @RequestMapping("/calc")
    public String calc(Integer num1,Integer num2){
        if (num1 == num2 || num2 == null){
            return "参数错误";
        }
        return "结果=" + (num1 + num2);
    }
}
